[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
Copy function
DECLARATION: Copy(S : String; Index : Integer; Count : Integer)
PURPOSE: Returns the substring of a string
UNIT: System
RESULT TYPE: String
REMARKS: Where S is a string-type expression and Index and
Count are integers. This will return a string containing
Count characters starting from the Indexth character in s.
If Index is larger than the length of S, an empty string
is returned. If Count specifies more characters than remain,
in S, only the remainder of S is returned.
EXAMPLE: Var
S : String[25];
Sub1 : String[10];
Sub2 : String[5];
Begin
S := 'This is a complete string';
Sub1 := Copy(S,1,7);
Sub2 := Copy(S,6,2);
Writeln(S);
Writeln(Sub1); { 'This is' }
Writeln(Sub2); { 'is' }
End.
See Also:
ConCat
Delete
Insert
Length
Pos
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson